package de.revdev.llt.bean.facade;

import java.util.HashMap;
import java.util.Map;
import javax.ejb.embeddable.EJBContainer;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;

/**
 *
 * @author f.lindermaier
 */
@RunWith(Suite.class)
@Suite.SuiteClasses({
    UserFacadeTest.class,
    AddressFacadeTest.class,
    CategoryFacadeTest.class,
    CredentialFacadeTest.class,
    FileCardBoxFacadeTest.class,
    FileCardFacadeTest.class,
    HistoryFacadeTest.class,
    LearnStatusFCBFacadeTest.class,
    LearnStatusFCFacadeTest.class,
    PrivateClassRoomFacadeTest.class,
    PublicClassRoomFacadeTest.class})
public class FacadeSuite {

    public static EJBContainer container;
    private static EntityManagerFactory emf;
    public static EntityManager em;

    @BeforeClass
    public static void setUpClass() throws Exception {
        Map<Object, Object> properties = new HashMap<>();
        properties.put(EJBContainer.APP_NAME, "LLTTest");
        container = javax.ejb.embeddable.EJBContainer.createEJBContainer(properties);
        emf = Persistence.createEntityManagerFactory("LetsLearnTogetherPU");
        em = emf.createEntityManager();
    }

    @AfterClass
    public static void tearDownClass() throws Exception {
        container.close();
    }

    @Before
    public void setUp() throws Exception {
    }

    @After
    public void tearDown() throws Exception {
    }
}
